package com.dinzeer.sjapadder.data;

import cn.mmf.slashblade_addon.data.SlashBladeAddonBuiltInRegistry;
import mods.flammpfeil.slashblade.data.builtin.SlashBladeBuiltInRegistry;
import mods.flammpfeil.slashblade.init.SBItems;
import mods.flammpfeil.slashblade.recipe.RequestDefinition;
import mods.flammpfeil.slashblade.recipe.SlashBladeIngredient;
import mods.flammpfeil.slashblade.recipe.SlashBladeShapedRecipeBuilder;
import net.minecraft.data.PackOutput;
import net.minecraft.data.recipes.FinishedRecipe;
import net.minecraft.data.recipes.RecipeProvider;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraftforge.common.crafting.conditions.IConditionBuilder;
import twilightforest.init.TFItems;

import java.util.function.Consumer;

public class SjaRecipeProvioder extends RecipeProvider implements IConditionBuilder {
    //合成表datagen
    public SjaRecipeProvioder(PackOutput output) {
        super(output);
    }
    protected void buildRecipes(Consumer<FinishedRecipe> consumer){
        SlashBladeShapedRecipeBuilder.shaped(SjaBuiltInRegsitry.kamuyex_water.location())
                .pattern("ABA")
                .pattern("CDC")
                .pattern("AEA")
                .define('A', SBItems.proudsoul_sphere)
                .define('D', Items.DIAMOND_BLOCK)
                .define('C', Items .NETHER_STAR)
                .define('B', SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SlashBladeAddonBuiltInRegistry.KAMUY_WATER.location())
                                .killCount(1000)
                                .proudSoul(3000)
                                .refineCount(10)
                                .build()
                ))
                .define('E',SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SlashBladeAddonBuiltInRegistry.KIRISAYA.location())
                                .killCount(1000)
                                .proudSoul(3000)
                                .refineCount(10)
                                .build()
                ))
                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);
        SlashBladeShapedRecipeBuilder.shaped(SjaBuiltInRegsitry.kamuyex_fire.location())
                .pattern("ABA")
                .pattern("CDC")
                .pattern("AEA")
                .define('A', SBItems.proudsoul_sphere)
                .define('D', Items.DIAMOND_BLOCK)
                .define('C', Items.NETHER_STAR)
                .define('B',SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SlashBladeAddonBuiltInRegistry.KAMUY_FIRE.location())
                                .killCount(1000)
                                .proudSoul(3000)
                                .refineCount(10)
                                .build()
                ))
                .define('E',SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SlashBladeAddonBuiltInRegistry.LAEMMLE.location())
                                .killCount(1000)
                                .proudSoul(3000)
                                .refineCount(10)
                                .build()
                ))
                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);
        SlashBladeShapedRecipeBuilder.shaped(SjaBuiltInRegsitry.kamuyex_ligghtning.location())
                .pattern("ABA")
                .pattern("CDC")
                .pattern("AEA")
                .define('A', SBItems.proudsoul_sphere)
                .define('D', Items.DIAMOND_BLOCK)
                .define('C', Items.NETHER_STAR)
                .define('B',SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SlashBladeAddonBuiltInRegistry.KAMUY_LIGHTING.location())
                                .killCount(1000)
                                .proudSoul(3000)
                                .refineCount(10)
                                .build()
                ))
                .define('E',SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SlashBladeAddonBuiltInRegistry.GREEN_MIST.location())
                                .killCount(1000)
                                .proudSoul(3000)
                                .refineCount(10)
                                .build()
                ))
                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);



        SlashBladeShapedRecipeBuilder.shaped(SjaBuiltInRegsitry.crimsoncherryex.location())
                .pattern("ABA")
                .pattern("CDE")
                .pattern("AFA")
                .define('A', Items.DIAMOND_BLOCK)
                .define('B',SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SlashBladeAddonBuiltInRegistry.CRIMSONCHERRY.location())
                                .killCount(3000)
                                .proudSoul(30000)
                                .refineCount(20)
                                .build()
                ))
                .define('F',SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SlashBladeAddonBuiltInRegistry.MURAKUMO.location())
                                .killCount(3000)
                                .proudSoul(30000)
                                .refineCount(20)
                                .build()
                ))
                .define('C',SBItems.proudsoul_trapezohedron)
                .define('E',Items.TOTEM_OF_UNDYING)
                .define('D',Items.NETHERITE_INGOT)

                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);

        SlashBladeShapedRecipeBuilder.shaped(SjaBuiltInRegsitry.nihilulex.location())
                .pattern("ABA")
                .pattern("CDE")
                .pattern("AFA")
                .define('A', Items.DIAMOND_BLOCK)
                .define('B',SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SlashBladeAddonBuiltInRegistry.NIHILUL.location())
                                .killCount(3000)
                                .proudSoul(30000)
                                .refineCount(20)
                                .build()
                ))
                .define('F',SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SlashBladeAddonBuiltInRegistry.DARK_RAVEN.location())
                                .killCount(3000)
                                .proudSoul(30000)
                                .refineCount(20)
                                .build()
                ))
                .define('C',SBItems.proudsoul_trapezohedron)
                .define('E',Items.TOTEM_OF_UNDYING)
                .define('D',Items.NETHERITE_INGOT)

                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);

        SlashBladeShapedRecipeBuilder.shaped(SjaBuiltInRegsitry.nihilbxex.location())
                .pattern("ABA")
                .pattern("ACA")
                .pattern("ADA")
                .define('A', Items.DIAMOND_BLOCK)
                .define('B',SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SjaBuiltInRegsitry.nihilulex.location())
                                .build()
                ))
                .define('C',SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SlashBladeAddonBuiltInRegistry.NIHILBX.location())
                                .build()
                ))
                .define('D',SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SjaBuiltInRegsitry.crimsoncherryex.location())
                                .build()
                ))

                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);

        SlashBladeShapedRecipeBuilder.shaped(SjaBuiltInRegsitry.kamuy_life.location())
                .pattern("ABA")
                .pattern("CDE")
                .pattern("AFA")
                .define('A', SBItems.proudsoul_sphere)
                .define('B',Items.ROSE_BUSH)
                .define('C',Items.DANDELION)
                .define('D',SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SlashBladeAddonBuiltInRegistry.KAMUY_NONE.location())
                                .refineCount(20)
                                .killCount(500)
                                .proudSoul(5000)
                                .build()
                ))
                .define('E',Items.POPPY)
                .define('F',Items.ALLIUM)
                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);

        SlashBladeShapedRecipeBuilder.shaped(SjaBuiltInRegsitry.kamuyex_life.location())
                .pattern("ABA")
                .pattern("CDC")
                .pattern("AEA")
                .define('A', SBItems.proudsoul_sphere)
                .define('D', Items.DIAMOND_BLOCK)
                .define('C', Items .NETHER_STAR)
                .define('B', SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SjaBuiltInRegsitry.kamuy_life.location())
                                .killCount(1000)
                                .proudSoul(3000)
                                .refineCount(10)
                                .build()
                ))
                .define('E',SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SlashBladeAddonBuiltInRegistry.SNOW_CROW.location())
                                .killCount(1000)
                                .proudSoul(3000)
                                .refineCount(10)
                                .build()
                ))
                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);

        SlashBladeShapedRecipeBuilder.shaped(SjaBuiltInRegsitry.black_soul.location())
                .pattern(" AB")
                .pattern("CDC")
                .pattern("BA ")
                .define('A', SBItems.proudsoul_trapezohedron)
                .define('B', Items.DIAMOND_BLOCK)
                .define('C', Items .OBSIDIAN)
                .define('D', SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SlashBladeBuiltInRegistry.DOUTANUKI.location())
                                .killCount(1000)
                                .proudSoul(3000)
                                .refineCount(10)
                                .build()
                ))
                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);


        SlashBladeShapedRecipeBuilder.shaped(SjaBuiltInRegsitry.blue_dream.location())
                .pattern("ABC")
                .pattern("DED")
                .pattern("FGA")
                .define('A', Items.SCULK_CATALYST)
                .define('B', SBItems.proudsoul_crystal)
                .define('C', SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SlashBladeAddonBuiltInRegistry.FROSTY_CHERRY.location())
                                .killCount(1000)
                                .proudSoul(3000)
                                .refineCount(10)
                                .build()
                ))
                .define('D', Items.SCUTE)
                .define('E', SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SlashBladeAddonBuiltInRegistry.KAMUY_LIGHTING.location())
                                .killCount(1000)
                                .proudSoul(3000)
                                .refineCount(10)
                                .build()
                ))
                .define('F', SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SlashBladeAddonBuiltInRegistry.FLUORESCENT_BAR.location())
                                .killCount(1000)
                                .proudSoul(3000)
                                .refineCount(10)
                                .build()
                ))
                .define('G', Items.BEACON)
                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);




        SlashBladeShapedRecipeBuilder.shaped(SjaBuiltInRegsitry.Agito_EX.location())
                .pattern("ABG")
                .pattern("CDC")
                .pattern("EFH")
                .define('A', Items.NETHER_STAR)
                .define('B', TFItems.NAGA_TROPHY.get())
                .define('G', TFItems.MAGIC_MAP_FOCUS.get())
                .define('C', TFItems.NAGA_SCALE.get())
                .define('D', SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SlashBladeBuiltInRegistry.AGITO.location())
                                .killCount(2000)
                                .proudSoul(20000)
                                .refineCount(15)
                                .build()
                ))
                .define('E', TFItems.IRONWOOD_INGOT.get())
                .define('F', Ingredient.of(
                        TFItems.LIFEDRAIN_SCEPTER.get(),
                        TFItems.TWILIGHT_SCEPTER.get(),
                        TFItems.ZOMBIE_SCEPTER.get()
                ))
                .define('H', SBItems.proudsoul_trapezohedron)
                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);

        SlashBladeShapedRecipeBuilder.shaped(SjaBuiltInRegsitry.Agito_True_EX.location())
                .pattern("ABC")
                .pattern("DEG")
                .pattern("FDA")
                .define('A', TFItems.KNIGHTMETAL_RING.get()) // 骑士金属环
                .define('B', SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SlashBladeAddonBuiltInRegistry.MURAKUMO.location()) // 神剑「天丛云」
                                .killCount(1000)
                                .proudSoul(10000)
                                .refineCount(10)
                                .build()
                ))
                .define('C', TFItems.KNIGHTMETAL_SWORD.get()) // 骑士剑
                .define('D', TFItems.FIERY_INGOT.get()) // 炽铁锭
                .define('E', SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SlashBladeBuiltInRegistry.OROTIAGITO.location()) // 名刀「大蛇鄂门」
                                .build()
                ))
                .define('F', TFItems.HYDRA_TROPHY.get())
                .define('G', SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SlashBladeBuiltInRegistry.YASHA_TRUE.location())
                                .build()
                ))
                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);

        SlashBladeShapedRecipeBuilder.shaped(SjaBuiltInRegsitry.kamuy_dark.location())
                .pattern("ABA")
                .pattern("CDE")
                .pattern("AFA")
                .define('A', SBItems.proudsoul_sphere) // 宝珠
                .define('B', Items.SCULK_SENSOR) // 幽匿感测器
                .define('C', Items.ECHO_SHARD) // 回响碎片
                .define('D', SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SlashBladeAddonBuiltInRegistry.KAMUY_NONE.location()) // 神威刀「虎杖丸」
                                .killCount(500)
                                .proudSoul(5000)
                                .refineCount(20)
                                .build()
                ))
                .define('E', Items.ENDER_EYE) // 末影之眼
                .define('F', Items.CALIBRATED_SCULK_SENSOR) // 校频幽匿感测器
                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);

        SlashBladeShapedRecipeBuilder.shaped(SjaBuiltInRegsitry.kamuyex_dark.location())
                .pattern("ABA")
                .pattern("CDC")
                .pattern("AEA")
                .define('A', SBItems.proudsoul_sphere) // 宝珠
                .define('B', Items.DIAMOND_BLOCK) // 钻石块
                .define('C', Items.NETHER_STAR) // 下界之星
                .define('D', SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SjaBuiltInRegsitry.kamuy_dark.location()) // 神威刀「诺克特」
                                .killCount(1000)
                                .proudSoul(10000)
                                .refineCount(15)
                                .build()
                ))
                .define('E', SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SlashBladeAddonBuiltInRegistry.DARK_RAVEN.location()) // 暗鸦
                                .killCount(1000)
                                .proudSoul(10000)
                                .refineCount(15)
                                .build()
                ))
                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);

        SlashBladeShapedRecipeBuilder.shaped(SjaBuiltInRegsitry.nihil_soul.location())
                .pattern("ABC")
                .pattern("DEF")
                .pattern("CHA")
                .define('A', Items.NETHER_STAR) // 下界之星
                .define('B', SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SlashBladeAddonBuiltInRegistry.NIHILEX.location()) // 血刀「似蛭」
                                .killCount(2000)
                                .proudSoul(15000)
                                .refineCount(20)
                                .build()
                ))
                .define('C', SBItems.proudsoul_crystal) // 耀魂结晶
                .define('D', SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SlashBladeAddonBuiltInRegistry.MOONLIGHT_CHERRY.location()) // 月光樱「吹雪一闪」
                                .killCount(2000)
                                .proudSoul(15000)
                                .refineCount(20)
                                .build()
                ))
                .define('E', SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SlashBladeAddonBuiltInRegistry.FROSTY_CHERRY.location()) // 冻樱刀「雪花苍月」
                                .killCount(2000)
                                .proudSoul(15000)
                                .refineCount(20)
                                .build()
                ))
                .define('F', SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SlashBladeAddonBuiltInRegistry.YUKARI.location()) // 结月刀「付喪-改」
                                .killCount(2000)
                                .proudSoul(15000)
                                .refineCount(20)
                                .build()
                ))
                .define('H', SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SlashBladeAddonBuiltInRegistry.BLUE.location()) // 利刃「苍梅」
                                .killCount(2000)
                                .proudSoul(15000)
                                .refineCount(20)
                                .build()
                ))
                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);

        SlashBladeShapedRecipeBuilder.shaped(SjaBuiltInRegsitry.toyoko.location())
                .pattern("ABC")
                .pattern("DEF")
                .pattern("GHI")
                .define('A', Items.ECHO_SHARD) // 回响碎片
                .define('B', SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SlashBladeBuiltInRegistry.TUKUMO.location()) // 付喪
                                .killCount(1500)
                                .proudSoul(12000)
                                .refineCount(15)
                                .build()
                ))
                .define('C', Items.BEACON) // 信标
                .define('D', Items.GOLDEN_APPLE) // 金苹果
                .define('E', Items.WITHER_ROSE) // 凋零玫瑰
                .define('F', Items.GHAST_TEAR) // 恶魂之泪
                .define('G', Items.WITHER_SKELETON_SKULL) // 凋零骷髅头
                .define('H', SlashBladeIngredient.of(
                        RequestDefinition.Builder.newInstance()
                                .name(SlashBladeAddonBuiltInRegistry.YUKARI.location()) // 付喪•改
                                .killCount(1500)
                                .proudSoul(12000)
                                .refineCount(15)
                                .build()
                ))
                .define('I', SBItems.proudsoul_trapezohedron) // 偏四面八方之魂
                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);







    }
}
